<extend name="public:template" />
<block name="title">站点配置</block>
<block name="content">
    <div class="wrap-page">
        <div id="pageConfigSite" class="page-content">
            <include file="public:subtabs"/>
            <form class="form default-style" enctype="multipart/form-data" role="form" id="setting_site_form" action="{:u('backend/settings/index')}" method="post">
                <div id="boxConfigSite" class="box">
                    <div class="box-content">

                        <dl class="clearfix">
                            <dt><label>网站Title：</label></dt>
                            <dd>
                                <div class="item-field clearfix">
                                    <input  type="text" class="textfield" value="{$list.setting_site_title.data}" name="setting_site_title" id="setting_site_title"
                                            placeholder="请输入网站Title" />
                                </div>
                            </dd>
                        </dl>
                        <dl class="clearfix">
                            <dt><label>网站域名：</label></dt>
                            <dd>
                                <div class="item-field clearfix">
                                    <input type="text" class="textfield" value="{$list.setting_site_domain.data}" name="setting_site_domain" id="setting_site_domain"
                                           placeholder="请输入网站域名"/>
                                </div>
                                <div class="item-prompt">提示：请以“/”结尾</div>
                            </dd>
                        </dl>

                        <dl class="clearfix">
                            <dt><label>网站状态：</label></dt>
                            <dd>
                                <div class="item-field clearfix">
                                    <label class="checkbox-inline">
                                        <input type="radio" name="setting_site_status"  value="1" <if condition="$list['setting_site_status']['data'] eq '1'"> checked="checked" </if>>启用
                                    </label>
                                    <label class="checkbox-inline">
                                        <input type="radio" name="setting_site_status" value="0" <if condition="$list['setting_site_status']['data'] eq '0'"> checked="checked" </if> >关闭
                                    </label>
                                </div>
                            </dd>
                        </dl>

                        <dl class="clearfix">
                            <dt><label>开放注册：</label></dt>
                            <dd>
                                <div class="item-field clearfix">
                                    <label class="checkbox-inline">
                                        <input type="radio" name="setting_site_register"  value="1" <if condition="$list['setting_site_register']['data'] eq '1'"> checked="checked" </if>>是
                                    </label>
                                    <label class="checkbox-inline">
                                        <input type="radio" name="setting_site_register" value="0" <if condition="$list['setting_site_register']['data'] eq '0'"> checked="checked" </if> >否
                                    </label>
                                </div>
                            </dd>
                        </dl>

                        <dl class="clearfix">
                            <dt><label>备案信息：</label></dt>
                            <dd>
                                <div class="item-field clearfix">
                                    <textarea  class="textarea" name="setting_site_mark" id="setting_site_mark"
                                               placeholder="请输入网站备案信息">{$list.setting_site_mark.data}</textarea>
                                </div>
                                <!--<div class="item-prompt">提示：页面meta标签对关键字内容的描述(description)，搜索引擎优化使用</div>-->
                            </dd>
                        </dl>

                        <dl class="clearfix">
                            <dt><label>站长邮箱：</label></dt>
                            <dd>
                                <div class="item-field clearfix">
                                    <input type="text" class="textfield" value="{$list.setting_site_admin_email.data}" name="setting_site_admin_email" id="setting_admin_email"
                                           placeholder="请输入站长邮箱"/>
                                </div>
                                <div class="item-prompt">提示：请输入正确的邮箱</div>
                            </dd>
                        </dl>

                        <dl class="clearfix">
                            <dt><label>统计代码：</label></dt>
                            <dd>
                                <div class="item-field clearfix">
                                    <textarea class="textarea" rows="3" name="setting_site_count_code" placeholder="请输入统计代码">{$list.setting_site_count_code.data}</textarea>
                                </div>
                            </dd>
                        </dl>

                        <dl class="clearfix">
                            <dt><label>版权信息：</label></dt>
                            <dd>
                                <div class="item-field clearfix">
                                    <textarea class="textarea" name="setting_site_copyright" rows="3" placeholder="请输入版权信息">{$list.setting_site_copyright.data}</textarea>
                                </div>
                                <div class="item-prompt"></div>
                            </dd>
                        </dl>

        </div>
    </div>
    <div class="page-buttons clearfix">
        <div class="fl-l">
            <button type="button" class="setting-btn button button-blue">保存</button>
        </div>
    </div>
    </form>
    </div>
    </div>
</block>

<block name="script">
    <script>
        $(document).ready(function(){
            $('.setting-btn').click(function(){
                var form_id = $(this).parents('form').prop('id');
                //数据验证
                $.ajax({
                    type: "POST",
                    url: $('#'+form_id).attr('action'),
                    data: $('#'+form_id).serialize(),
                    dataType: "json",
                    success:function(data){
                        if(data.status)
                        {
                            layer.msg(data.msg,{offset:[150],icon: 1,time:2000, shade: [0.1, '#ccc']});
                        } else {
                            layer.msg(data.msg,{offset:[150],icon: 2,time:2000, shade: [0.1, '#ccc']})
                        }

                    }
                });
                return false;
            });
        });
    </script>
</block>